package com.twl.app.base.ctrl;

import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;

import org.springframework.beans.factory.annotation.Autowired;

import com.twl.app.base.entity.Checktemplet;
import com.twl.app.base.entity.Uemp;
import com.twl.app.base.util.BeanFactoryHolder;
import com.twl.ws.web.ImportServerImpl;

public class ActionSalarySum implements Callable<String> {

	private CountDownLatch countDownLatch;
	private Checktemplet checktemplet ;
	private Uemp uemp ;

	public ActionSalarySum(CountDownLatch countDownLatch,
			Checktemplet checktemplet,Uemp uemp) {
		super();
		this.countDownLatch = countDownLatch;
		this.checktemplet = checktemplet;
		this.uemp = uemp ;
	}


	@Override
	public String call() throws Exception {
		//String str = null;
		ImportServerImpl importServerImpl =(ImportServerImpl) BeanFactoryHolder.getBean("importServerImpl");
		try {

			 importServerImpl.action(this.checktemplet,this.uemp);
			//System.err.println(str);

		} catch (Exception e) {
			e.printStackTrace();
			return "call---false";
		} finally {
			countDownLatch.countDown();
		}
		//return str;
		return "call---success";
	}

}
